home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
c
/
tvcolor.exe
/
COLORDLG.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1992-06-27
|
8KB
|
257 lines
/*-----------------------------------------------------------------------*/
/* filename - colordlg.hpp */
/* */
/* function(s) */
/* defines the class TVColorDialog */
/* */
/*-----------------------------------------------------------------------*/
/*-----------------------------------------------------------------------*/
/* */
/* TVColorDialog - Version 1.01 */
/* */
/* Copyright (C) 1992 Michael Newton and Comsoft Software */
/* All Rights Reserved. */
/* */
/*-----------------------------------------------------------------------*/
/*-----------------------------------------------------------------------*/
/* 06-27-92 */
/* Recompiled COLORDLG.LIB using Borland BC++ ver. 3.1 */
/*-----------------------------------------------------------------------*/
// TPatternCluster ********************************************************
#if !defined __PATCLUSTER_HPP
#define __PATCLUSTER_HPP
class far TEvent;
class far TPoint;
class far TRect;
class far TSItem;
class far TStringCollection;
class TPatternCluster : public TView
{
public:
TPatternCluster(const TRect& bounds, TSItem *aStrings);
~TPatternCluster();
virtual ushort dataSize();
void drawBox(const char *icon, char marker);
virtual void getData(void *rec);
virtual void setData(void *rec);
ushort getHelpCtx();
virtual TPalette& getPalette() const;
virtual void handleEvent(TEvent& event);
virtual Boolean mark(int item);
virtual void press(int item);
virtual void movedTo(int item);
virtual void setState(ushort aState, Boolean enable);
protected:
ushort value;
int sel;
TStringCollection *strings;
private:
int column(int item);
int findSel(TPoint p);
int row(int item);
virtual const char *streamableName() const
{
return name;
};
protected:
TPatternCluster(StreamableInit);
virtual void write(opstream&);
virtual void *read(ipstream&);
public:
static const char * const near name;
static TStreamable *build();
};
inline ipstream& operator >> (ipstream& is, TPatternCluster& cl)
{
return is >> (TStreamable&) cl;
};
inline ipstream& operator >> (ipstream& is, TPatternCluster*& cl)
{
return is >> (void *&) cl;
};
inline opstream& operator << (opstream& os, TPatternCluster& cl)
{
return os << (TStreamable&) cl;
};
inline opstream& operator << (opstream& os, TPatternCluster* cl)
{
return os << (TStreamable *) cl;
};
#endif // End of __PATCLUSTER_HPP
// TPatternButtons ********************************************************
#if !defined __PATBUTTONS_HPP
#define __PATBUTTONS_HPP
class far TRect;
class far TSItem;
class TPatternButtons : public TPatternCluster
{
public:
TPatternButtons(const TRect& bounds, TSItem *aStrings);
virtual void draw();
virtual Boolean mark(int item);
virtual void movedTo(int item);
virtual void press(int item);
virtual void setData(void *rec);
virtual void getData(void *rec);
private:
static const char * near button;
virtual const char *streamableName() const
{
return name;
};
protected:
TPatternButtons(StreamableInit);
public:
static const char * const near name;
static TStreamable *build();
};
inline ipstream& operator >> (ipstream& is, TPatternButtons& cl)
{
return is >> (TStreamable&) cl;
};
inline ipstream& operator >> (ipstream& is, TPatternButtons*& cl)
{
return is >> (void *&) cl;
};
inline opstream& operator << (opstream& os, TPatternButtons& cl)
{
return os << (TStreamable&) cl;
};
inline opstream& operator << (opstream& os, TPatternButtons* cl)
{
return os << (TStreamable *) cl;
};
// Inline constructor
inline TPatternButtons::TPatternButtons(const TRect& bounds,
TSItem *aStrings) :
TPatternCluster(bounds, aStrings)
{
}
#endif // End of __PATBUTTONS_HPP
// TVColorDialog **********************************************************
#if !defined __COLORDLG_HPP
#define __COLORDLG_HPP
class far TColorGroup;
class far TEvent;
class far TColorDisplay;
class far TColorGroupList;
class far TLabel;
class far TColorSelector;
class far TMonoSelector;
class far TPalette;
#define MAXPATTERNS 13
class TVColorDialog : public TDialog
{
public:
TVColorDialog(TPalette *aPalette,
TColorGroup *aGroups,
TSItem *items,
Boolean addHelpButton = False);
~TVColorDialog();
virtual ushort dataSize();
virtual void getData(void *rec);
virtual void setData(void *rec);
virtual void handleEvent(TEvent& event);
TPalette *pal;
TPatternButtons *patSel;
protected:
TColorDisplay *display;
TColorGroupList *groups;
TLabel *forLabel;
TColorSelector *forSel;
TLabel *bakLabel;
TColorSelector *bakSel;
TLabel *monoLabel;
TMonoSelector *monoSel;
TLabel *patLabel;
private:
static const char * near colors;
static const char * near groupText;
static const char * near itemText;
static const char * near forText;
static const char * near bakText;
static const char * near textText;
static const char * near colorText;
static const char * near okText;
static const char * near cancelText;
static const char * near patternText;
static const char * near helpText;
virtual const char *streamableName() const
{
return name;
};
protected:
TVColorDialog(StreamableInit);
virtual void write(opstream&);
virtual void *read(ipstream&);
public:
static const char * const near name;
static TStreamable *build();
};
inline ipstream& operator >> (ipstream& is, TVColorDialog& cl)
{
return is >> (TStreamable&) cl;
};
inline ipstream& operator >> (ipstream& is, TVColorDialog*& cl)
{
return is >> (void *&) cl;
};
inline opstream& operator << (opstream& os, TVColorDialog& cl)
{
return os << (TStreamable&) cl;
};
inline opstream& operator << (opstream& os, TVColorDialog* cl)
{
return os << (TStreamable *) cl;
}
#endif // End of __COLORDLG_HPP
// End of __COLORDLG_HPP